package cn.hanyx.vlog.articleservice.feignclient;

import cn.hanyx.vlog.articleservice.dto.ResponseObject;
import cn.hanyx.vlog.articleservice.entity.Video;
import cn.hanyx.vlog.articleservice.feignclient.fallback.VideoFeignClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * VideoFeignClient
 * 这是一个OpenFeign客户端,video-service是数据提供方在nacos中注册的微服务名
 */
@FeignClient(value = "video-service", fallbackFactory = VideoFeignClientFallbackFactory.class)
@RequestMapping("/video")
public interface VideoFeignClient {

    @GetMapping("/{articleId}")
    public ResponseObject<Video> findByArticleId(@PathVariable(value = "articleId") Long articleId);

}
